#include<func.h>
int main (int argc,char * argv[])
{
   ARGS_CHECK(argc,3);
   int fdr = open(argv[1],O_RDONLY);
   int fdw = open(argv[2],O_WRONLY);
   printf("I am chat 1\n");
   char buf [128] = {0};
   while(1)
   {
    memset(buf,0,sizeof(buf));
    read(fdr,buf,sizeof(buf)); printf("buf = %s\n",buf);
    
    memset(buf,0,sizeof(buf));
   
   read(STDIN_FILENO,buf,sizeof(buf)); 
    write(fdw,buf,strlen(buf)-1);

   
   }
   return 0;
}